﻿///***************************************************************
/// 시  스  템 : Updms.Etc.Dac
/// 단위시스템 : ETC
/// 계      층 : Data Access Layer
/// 프로그램명 : Etc_Dac_UPDMS_ETC_PLANNER
/// 파  일  명 : Etc_Dac_UPDMS_ETC_PLANNER.cs
/// 설      명 : 플래너
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-11-24 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;

namespace Updms.Etc.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Etc_Dac_UPDMS_ETC_PLANNER : Base.AppFramework.DacBase
	{
		public Etc_Dac_UPDMS_ETC_PLANNER()
		{
		}

		#region NT [Select]

		[AutoComplete]
		public DataSet Select(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Select";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_ETC_PLANNER", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [SelectMonthly]
		
		[AutoComplete]
		public DataSet SelectMonthly(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Select_Monthly";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_ETC_PLANNER", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectYearly]

		[AutoComplete]
		public DataSet SelectYearly(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Select_Yearly";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_ETC_PLANNER", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Insert]
	
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Update";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_seq)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("Seq", ls_seq)
			};
			
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [InsertXml]

		/// <summary>
		/// 저장 - XML형식
		/// </summary>
		/// <param name="ls_data"></param>
		/// <returns></returns>
		[AutoComplete]
		public int InsertXml(string ls_xml)
		{
			string strSql = "usp_UPDMS_ETC_PLANNER_Insert_Xml";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

	}
}
